from itertools import count

def nr_rectangles(x,y):
    return (x + 1) * x * (y + 1) * y / 4

goal = 2 * 1000 * 1000

closest = 0
area = 0

for x in count():
    if nr_rectangles(x, 1) > goal: break
    
    for y in xrange(1, x + 1):
        nr = nr_rectangles(x, y)
        if abs(goal - nr) < abs(goal - closest):
            print nr, x, y
            closest = nr
            area = x * y
            
print closest, area
            

        

    
        
            
        
